package com.qf.controller;

import com.qf.service.DetailsService;
import com.qf.service.impl.DetailsServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/*
杨威
2021/9/25
16:09
*/
@WebServlet("/delete")
public class DeleteController extends HttpServlet {
    DetailsService detailsService=new DetailsServiceImpl();
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String id = request.getParameter("id");
        int i = detailsService.deleteDetails(Integer.valueOf(id));
        response.getWriter().println(i);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request, response);
    }
}
